package ir.sourcecodes.goals;

import androidx.appcompat.app.AppCompatActivity;

import android.app.ProgressDialog;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.AssetManager;
import android.graphics.Bitmap;
import android.net.ConnectivityManager;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.os.StrictMode;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.Toast;

import com.google.android.gms.ads.AdListener;
import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.AdView;
import com.google.android.gms.ads.InterstitialAd;
import com.google.android.gms.ads.MobileAds;
import com.google.android.gms.ads.initialization.InitializationStatus;
import com.google.android.gms.ads.initialization.OnInitializationCompleteListener;
import com.pushpole.sdk.PushPole;
import com.scientist.shotgoals.R;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.lang.reflect.Method;

@SuppressWarnings("ALL")
public class MainActivity extends AppCompatActivity  {

    //File file1;
    ImageView[] g=new ImageView[100];
    Button[] fav=new Button[100];
    String videoFilePath[]=new String[100];
    Bitmap thumbnail[]=new Bitmap[100];
    private ProgressBar spinner;
    ProgressDialog dialog;
    Intent intent;
    File sdcard;
    Boolean[] isfav=new Boolean[100];
    private SharedPreferences sp;
    AdView mAdView;
    InterstitialAd mInterstitialAd;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        dialog = ProgressDialog.show(this, "Loading Videos..",
                "Loading. Please wait...", true);
        checkExtenalstoragestate();

        if (checkExtenalstoragestate()){
            File directory = new File(getExternalFilesDir(null),"");
            File[] contents = directory.listFiles();
// the directory file is not really a directory..
            if (contents == null) {

                directory.mkdirs();
                copyAssets();

            }
// Folder is empty
            else if (contents.length == 0) {
                directory.mkdirs();
                copyAssets();

            }
// Folder contains files
            else {

            }

        }
        Connects();
        loadsp();
        loadad();
        isNetworkConnected();



    }

    private boolean isNetworkConnected() {
        ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);

        return cm.getActiveNetworkInfo() != null && cm.getActiveNetworkInfo().isConnected();
    }

    private void loadad() {
        PushPole.initialize(this,true);

        MobileAds.initialize(this, new OnInitializationCompleteListener() {
            @Override
            public void onInitializationComplete(InitializationStatus initializationStatus) {
            }
        });
        mAdView = findViewById(R.id.adView);
        AdRequest adRequest = new AdRequest.Builder().build();
        mAdView.loadAd(adRequest);
        mInterstitialAd = new InterstitialAd(this);
        mInterstitialAd.setAdUnitId(ads.adinter);
        mInterstitialAd.loadAd(new AdRequest.Builder().build());
        mInterstitialAd.setAdListener(new AdListener() {
            @Override
            public void onAdClosed() {
                // Load the next interstitial.
                mInterstitialAd.loadAd(new AdRequest.Builder().build());
            }

        });
    }

    private void loadsp() {
        sp=getApplicationContext().getSharedPreferences("fav",0);
       // Boolean fav1=sp.getBoolean("isfav1",false);
        isfav[1]=sp.getBoolean("isfav1",false);
        isfav[2]=sp.getBoolean("isfav2",false);
        isfav[3]=sp.getBoolean("isfav3",false);
        isfav[4]=sp.getBoolean("isfav4",false);
        isfav[5]=sp.getBoolean("isfav5",false);
        isfav[6]=sp.getBoolean("isfav6",false);
        isfav[7]=sp.getBoolean("isfav7",false);
        isfav[8]=sp.getBoolean("isfav8",false);
        isfav[9]=sp.getBoolean("isfav9",false);
        isfav[10]=sp.getBoolean("isfav10",false);
        isfav[11]=sp.getBoolean("isfav11",false);
        isfav[12]=sp.getBoolean("isfav12",false);
        isfav[13]=sp.getBoolean("isfav13",false);
        isfav[14]=sp.getBoolean("isfav14",false);
        isfav[15]=sp.getBoolean("isfav15",false);
        isfav[16]=sp.getBoolean("isfav16",false);
        isfav[17]=sp.getBoolean("isfav17",false);
        isfav[18]=sp.getBoolean("isfav18",false);
        isfav[19]=sp.getBoolean("isfav19",false);
        isfav[20]=sp.getBoolean("isfav20",false);
        isfav[21]=sp.getBoolean("isfav21",false);
        isfav[22]=sp.getBoolean("isfav22",false);
        isfav[23]=sp.getBoolean("isfav23",false);
        isfav[24]=sp.getBoolean("isfav24",false);
        isfav[25]=sp.getBoolean("isfav25",false);
        isfav[26]=sp.getBoolean("isfav26",false);
        isfav[27]=sp.getBoolean("isfav27",false);
        isfav[28]=sp.getBoolean("isfav28",false);
        isfav[29]=sp.getBoolean("isfav29",false);
        isfav[30]=sp.getBoolean("isfav30",false);
        isfav[31]=sp.getBoolean("isfav31",false);
        isfav[32]=sp.getBoolean("isfav32",false);
        isfav[33]=sp.getBoolean("isfav33",false);
        isfav[34]=sp.getBoolean("isfav34",false);
        isfav[35]=sp.getBoolean("isfav35",false);
        isfav[36]=sp.getBoolean("isfav36",false);
        isfav[37]=sp.getBoolean("isfav37",false);
        isfav[38]=sp.getBoolean("isfav38",false);
        isfav[39]=sp.getBoolean("isfav39",false);
        isfav[40]=sp.getBoolean("isfav40",false);
        isfav[41]=sp.getBoolean("isfav41",false);
        isfav[42]=sp.getBoolean("isfav42",false);
        isfav[43]=sp.getBoolean("isfav43",false);
        isfav[44]=sp.getBoolean("isfav44",false);
        isfav[45]=sp.getBoolean("isfav45",false);
        isfav[46]=sp.getBoolean("isfav46",false);
        isfav[47]=sp.getBoolean("isfav47",false);
        isfav[48]=sp.getBoolean("isfav48",false);
        isfav[49]=sp.getBoolean("isfav49",false);
        isfav[50]=sp.getBoolean("isfav50",false);
        isfav[51]=sp.getBoolean("isfav51",false);
        isfav[52]=sp.getBoolean("isfav52",false);
        isfav[53]=sp.getBoolean("isfav53",false);
        isfav[54]=sp.getBoolean("isfav54",false);
        isfav[55]=sp.getBoolean("isfav55",false);
        isfav[56]=sp.getBoolean("isfav56",false);
        isfav[57]=sp.getBoolean("isfav57",false);
        isfav[58]=sp.getBoolean("isfav58",false);
        isfav[59]=sp.getBoolean("isfav59",false);
        isfav[60]=sp.getBoolean("isfav60",false);
        isfav[61]=sp.getBoolean("isfav61",false);
        isfav[62]=sp.getBoolean("isfav62",false);
        isfav[63]=sp.getBoolean("isfav63",false);
        isfav[64]=sp.getBoolean("isfav64",false);
        isfav[65]=sp.getBoolean("isfav65",false);
        isfav[66]=sp.getBoolean("isfav66",false);
        isfav[67]=sp.getBoolean("isfav67",false);
        isfav[68]=sp.getBoolean("isfav68",false);
        isfav[69]=sp.getBoolean("isfav69",false);
        isfav[70]=sp.getBoolean("isfav70",false);
        isfav[71]=sp.getBoolean("isfav71",false);
        isfav[72]=sp.getBoolean("isfav72",false);
        isfav[73]=sp.getBoolean("isfav73",false);
        isfav[74]=sp.getBoolean("isfav74",false);
        isfav[75]=sp.getBoolean("isfav75",false);
        isfav[76]=sp.getBoolean("isfav76",false);
        isfav[77]=sp.getBoolean("isfav77",false);
        isfav[78]=sp.getBoolean("isfav78",false);
        isfav[79]=sp.getBoolean("isfav79",false);
        isfav[80]=sp.getBoolean("isfav80",false);
        isfav[81]=sp.getBoolean("isfav81",false);
        isfav[82]=sp.getBoolean("isfav82",false);
        isfav[83]=sp.getBoolean("isfav83",false);
        isfav[84]=sp.getBoolean("isfav84",false);
        isfav[85]=sp.getBoolean("isfav85",false);
        isfav[86]=sp.getBoolean("isfav86",false);
        isfav[87]=sp.getBoolean("isfav87",false);
        isfav[88]=sp.getBoolean("isfav88",false);
        isfav[89]=sp.getBoolean("isfav89",false);
        isfav[90]=sp.getBoolean("isfav90",false);
        isfav[91]=sp.getBoolean("isfav91",false);
        isfav[92]=sp.getBoolean("isfav92",false);
        isfav[93]=sp.getBoolean("isfav93",false);
        isfav[94]=sp.getBoolean("isfav94",false);
        isfav[95]=sp.getBoolean("isfav95",false);
        isfav[96]=sp.getBoolean("isfav96",false);
        isfav[97]=sp.getBoolean("isfav97",false);
        isfav[98]=sp.getBoolean("isfav98",false);
        isfav[99]=sp.getBoolean("isfav99",false);
        for (int i=1;i<isfav.length;i++){
            if (isfav[i]){
                fav[i].setBackgroundResource(R.drawable.fav);
            }else {
                fav[i].setBackgroundResource(R.drawable.star);
            }
        }


    }

    private void Connects() {
        if(Build.VERSION.SDK_INT>=24){
            try{
                Method m = StrictMode.class.getMethod("disableDeathOnFileUriExposure");
                m.invoke(null);
            }catch(Exception e){
                e.printStackTrace();
            }
        }
        if (!isNetworkConnected()){
            Toast.makeText(getApplicationContext(),"Please check internet connection",Toast.LENGTH_LONG).show();
        }

        g[1]=findViewById(R.id.img_g1);
        g[2]=findViewById(R.id.img_g2);
        g[3]=findViewById(R.id.img_g3);
        g[4]=findViewById(R.id.img_g4);
        g[5]=findViewById(R.id.img_g5);
        g[6]=findViewById(R.id.img_g6);
        g[7]=findViewById(R.id.img_g7);
        g[8]=findViewById(R.id.img_g8);
        g[9]=findViewById(R.id.img_g9);
        g[10]=findViewById(R.id.img_g10);
        g[11]=findViewById(R.id.img_g11);
        g[12]=findViewById(R.id.img_g12);
        g[13]=findViewById(R.id.img_g13);
        g[14]=findViewById(R.id.img_g14);
        g[15]=findViewById(R.id.img_g15);
        g[16]=findViewById(R.id.img_g16);
        g[17]=findViewById(R.id.img_g17);
        g[18]=findViewById(R.id.img_g18);
        g[19]=findViewById(R.id.img_g19);
        g[20]=findViewById(R.id.img_g20);
        g[21]=findViewById(R.id.img_g21);
        g[22]=findViewById(R.id.img_g22);
        g[23]=findViewById(R.id.img_g23);
        g[24]=findViewById(R.id.img_g24);
        g[25]=findViewById(R.id.img_g25);
        g[26]=findViewById(R.id.img_g26);
        g[27]=findViewById(R.id.img_g27);
        g[28]=findViewById(R.id.img_g28);
        g[29]=findViewById(R.id.img_g29);
        g[30]=findViewById(R.id.img_g30);
        g[31]=findViewById(R.id.img_g31);
        g[32]=findViewById(R.id.img_g32);
        g[33]=findViewById(R.id.img_g33);
        g[34]=findViewById(R.id.img_g34);
        g[35]=findViewById(R.id.img_g35);
        g[36]=findViewById(R.id.img_g36);
        g[37]=findViewById(R.id.img_g37);
        g[38]=findViewById(R.id.img_g38);
        g[39]=findViewById(R.id.img_g39);
        g[40]=findViewById(R.id.img_g40);
        g[41]=findViewById(R.id.img_g41);
        g[42]=findViewById(R.id.img_g42);
        g[43]=findViewById(R.id.img_g43);
        g[44]=findViewById(R.id.img_g44);
        g[45]=findViewById(R.id.img_g45);
        g[46]=findViewById(R.id.img_g46);
        g[47]=findViewById(R.id.img_g47);
        g[48]=findViewById(R.id.img_g48);
        g[49]=findViewById(R.id.img_g49);
        g[50]=findViewById(R.id.img_g50);
        g[51]=findViewById(R.id.img_g51);
        g[52]=findViewById(R.id.img_g52);
        g[53]=findViewById(R.id.img_g53);
        g[54]=findViewById(R.id.img_g54);
        g[55]=findViewById(R.id.img_g55);
        g[56]=findViewById(R.id.img_g56);
        g[57]=findViewById(R.id.img_g57);
        g[58]=findViewById(R.id.img_g58);
        g[59]=findViewById(R.id.img_g59);
        g[60]=findViewById(R.id.img_g60);
        g[61]=findViewById(R.id.img_g61);
        g[62]=findViewById(R.id.img_g62);
        g[63]=findViewById(R.id.img_g63);
        g[64]=findViewById(R.id.img_g64);
        g[65]=findViewById(R.id.img_g65);
        g[66]=findViewById(R.id.img_g66);
        g[67]=findViewById(R.id.img_g67);
        g[68]=findViewById(R.id.img_g68);
        g[69]=findViewById(R.id.img_g69);
        g[70]=findViewById(R.id.img_g70);
        g[71]=findViewById(R.id.img_g71);
        g[72]=findViewById(R.id.img_g72);
        g[73]=findViewById(R.id.img_g73);
        g[74]=findViewById(R.id.img_g74);
        g[75]=findViewById(R.id.img_g75);
        g[76]=findViewById(R.id.img_g76);
        g[77]=findViewById(R.id.img_g77);
        g[78]=findViewById(R.id.img_g78);
        g[79]=findViewById(R.id.img_g79);
        g[80]=findViewById(R.id.img_g80);
        g[81]=findViewById(R.id.img_g81);
        g[82]=findViewById(R.id.img_g82);
        g[83]=findViewById(R.id.img_g83);
        g[84]=findViewById(R.id.img_g84);
        g[85]=findViewById(R.id.img_g85);
        g[86]=findViewById(R.id.img_g86);
        g[87]=findViewById(R.id.img_g87);
        g[88]=findViewById(R.id.img_g88);
        g[89]=findViewById(R.id.img_g89);
        g[90]=findViewById(R.id.img_g90);
        g[91]=findViewById(R.id.img_g91);
        g[92]=findViewById(R.id.img_g92);
        g[93]=findViewById(R.id.img_g93);
        g[94]=findViewById(R.id.img_g94);
        g[95]=findViewById(R.id.img_g95);
        g[96]=findViewById(R.id.img_g96);
        g[97]=findViewById(R.id.img_g97);
        g[98]=findViewById(R.id.img_g98);
        g[99]=findViewById(R.id.img_g99);

        for (int i=0 ;i<isfav.length;i++){
            isfav[i]=false;
        }

        for(int i=0; i<fav.length; i++) {

                String buttonID = "fav" + i ;
                int resID = getResources().getIdentifier(buttonID, "id", getPackageName());
                fav[i] = ((Button) findViewById(resID));
           // fav[i].setOnClickListener((View.OnClickListener) this);


        }
        for (int i=1 ; i<g.length ; i++){
            g[i].setImageResource(R.drawable.players);

        }


/*

        videoFilePath[1] = getExternalFilesDir(null)+"/g1.mkv";
       thumbnail[1] = ThumbnailUtils.createVideoThumbnail(videoFilePath[1],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[1].setImageBitmap(thumbnail[1]);

 videoFilePath[2] = getExternalFilesDir(null)+"/g2.mkv";
        thumbnail[2] = ThumbnailUtils.createVideoThumbnail(videoFilePath[2],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[2].setImageBitmap(thumbnail[2]);

        videoFilePath[3] = getExternalFilesDir(null)+"/g3.mkv";
        thumbnail[3] = ThumbnailUtils.createVideoThumbnail(videoFilePath[3],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[3].setImageBitmap(thumbnail[3]);

       videoFilePath[4] = getExternalFilesDir(null)+"/g4.mkv";
        thumbnail[4] = ThumbnailUtils.createVideoThumbnail(videoFilePath[4],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[4].setImageBitmap(thumbnail[4]);

       videoFilePath[5] = getExternalFilesDir(null)+"/g5.mkv";
        thumbnail[5] = ThumbnailUtils.createVideoThumbnail(videoFilePath[5],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[5].setImageBitmap(thumbnail[5]);

       videoFilePath[6] = getExternalFilesDir(null)+"/g6.mkv";
        thumbnail[6] = ThumbnailUtils.createVideoThumbnail(videoFilePath[6],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[6].setImageBitmap(thumbnail[6]);

       videoFilePath[7] = getExternalFilesDir(null)+"/g7.mkv";
        thumbnail[7] = ThumbnailUtils.createVideoThumbnail(videoFilePath[7],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[7].setImageBitmap(thumbnail[7]);

       videoFilePath[8] = getExternalFilesDir(null)+"/g8.mkv";
        thumbnail[8] = ThumbnailUtils.createVideoThumbnail(videoFilePath[8],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[8].setImageBitmap(thumbnail[8]);

       videoFilePath[9] = getExternalFilesDir(null)+"/g9.mkv";
        thumbnail[9] = ThumbnailUtils.createVideoThumbnail(videoFilePath[9],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[9].setImageBitmap(thumbnail[9]);

       videoFilePath[10] = getExternalFilesDir(null)+"/g10.mkv";
        thumbnail[10] = ThumbnailUtils.createVideoThumbnail(videoFilePath[10],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[10].setImageBitmap(thumbnail[10]);

       videoFilePath[11] = getExternalFilesDir(null)+"/g11.mkv";
        thumbnail[11] = ThumbnailUtils.createVideoThumbnail(videoFilePath[11],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[11].setImageBitmap(thumbnail[11]);

       videoFilePath[12] = getExternalFilesDir(null)+"/g12.mkv";
        thumbnail[12] = ThumbnailUtils.createVideoThumbnail(videoFilePath[12],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[12].setImageBitmap(thumbnail[12]);

       videoFilePath[13] = getExternalFilesDir(null)+"/g13.mkv";
        thumbnail[13] = ThumbnailUtils.createVideoThumbnail(videoFilePath[13],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[13].setImageBitmap(thumbnail[13]);

       videoFilePath[14] = getExternalFilesDir(null)+"/g14.mkv";
        thumbnail[14] = ThumbnailUtils.createVideoThumbnail(videoFilePath[14],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[14].setImageBitmap(thumbnail[14]);

       videoFilePath[15] = getExternalFilesDir(null)+"/g15.mkv";
        thumbnail[15] = ThumbnailUtils.createVideoThumbnail(videoFilePath[15],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[15].setImageBitmap(thumbnail[15]);

       videoFilePath[16] = getExternalFilesDir(null)+"/g16.mkv";
        thumbnail[16] = ThumbnailUtils.createVideoThumbnail(videoFilePath[16],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[16].setImageBitmap(thumbnail[16]);

       videoFilePath[17] = getExternalFilesDir(null)+"/g17.mkv";
        thumbnail[17] = ThumbnailUtils.createVideoThumbnail(videoFilePath[17],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[17].setImageBitmap(thumbnail[17]);

       videoFilePath[18] = getExternalFilesDir(null)+"/g18.mkv";
        thumbnail[18] = ThumbnailUtils.createVideoThumbnail(videoFilePath[18],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[18].setImageBitmap(thumbnail[18]);

       videoFilePath[19] = getExternalFilesDir(null)+"/g19.mkv";
        thumbnail[19] = ThumbnailUtils.createVideoThumbnail(videoFilePath[19],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[19].setImageBitmap(thumbnail[19]);

       videoFilePath[20] = getExternalFilesDir(null)+"/g20.mkv";
        thumbnail[20] = ThumbnailUtils.createVideoThumbnail(videoFilePath[20],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[20].setImageBitmap(thumbnail[20]);

       videoFilePath[21] = getExternalFilesDir(null)+"/g21.mkv";
        thumbnail[21] = ThumbnailUtils.createVideoThumbnail(videoFilePath[21],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[21].setImageBitmap(thumbnail[21]);

       videoFilePath[22] = getExternalFilesDir(null)+"/g22.mkv";
        thumbnail[22] = ThumbnailUtils.createVideoThumbnail(videoFilePath[22],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[22].setImageBitmap(thumbnail[22]);

       videoFilePath[23] = getExternalFilesDir(null)+"/g23.mkv";
        thumbnail[23] = ThumbnailUtils.createVideoThumbnail(videoFilePath[23],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[23].setImageBitmap(thumbnail[23]);

       videoFilePath[24] = getExternalFilesDir(null)+"/g24.mkv";
        thumbnail[24] = ThumbnailUtils.createVideoThumbnail(videoFilePath[24],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[24].setImageBitmap(thumbnail[24]);

       videoFilePath[25] = getExternalFilesDir(null)+"/g25.mkv";
        thumbnail[25] = ThumbnailUtils.createVideoThumbnail(videoFilePath[25],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[25].setImageBitmap(thumbnail[25]);

       videoFilePath[26] = getExternalFilesDir(null)+"/g26.mkv";
        thumbnail[26] = ThumbnailUtils.createVideoThumbnail(videoFilePath[26],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[26].setImageBitmap(thumbnail[26]);

       videoFilePath[27] = getExternalFilesDir(null)+"/g27.mkv";
        thumbnail[27] = ThumbnailUtils.createVideoThumbnail(videoFilePath[27],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[27].setImageBitmap(thumbnail[27]);

       videoFilePath[28] = getExternalFilesDir(null)+"/g28.mkv";
        thumbnail[28] = ThumbnailUtils.createVideoThumbnail(videoFilePath[28],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[28].setImageBitmap(thumbnail[28]);

       videoFilePath[29] = getExternalFilesDir(null)+"/g29.mkv";
        thumbnail[29] = ThumbnailUtils.createVideoThumbnail(videoFilePath[29],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[29].setImageBitmap(thumbnail[29]);

       videoFilePath[30] = getExternalFilesDir(null)+"/g30.mkv";
        thumbnail[30] = ThumbnailUtils.createVideoThumbnail(videoFilePath[30],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[30].setImageBitmap(thumbnail[30]);

       videoFilePath[31] = getExternalFilesDir(null)+"/g31.mkv";
        thumbnail[31] = ThumbnailUtils.createVideoThumbnail(videoFilePath[31],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[31].setImageBitmap(thumbnail[31]);

       videoFilePath[32] = getExternalFilesDir(null)+"/g32.mkv";
        thumbnail[32] = ThumbnailUtils.createVideoThumbnail(videoFilePath[32],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[32].setImageBitmap(thumbnail[32]);

       videoFilePath[33] = getExternalFilesDir(null)+"/g33.mkv";
        thumbnail[33] = ThumbnailUtils.createVideoThumbnail(videoFilePath[33],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[33].setImageBitmap(thumbnail[33]);

       videoFilePath[34] = getExternalFilesDir(null)+"/g34.mkv";
        thumbnail[34] = ThumbnailUtils.createVideoThumbnail(videoFilePath[34],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[34].setImageBitmap(thumbnail[34]);

       videoFilePath[35] = getExternalFilesDir(null)+"/g35.mkv";
        thumbnail[35] = ThumbnailUtils.createVideoThumbnail(videoFilePath[35],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[35].setImageBitmap(thumbnail[35]);

       videoFilePath[36] = getExternalFilesDir(null)+"/g36.mkv";
        thumbnail[36] = ThumbnailUtils.createVideoThumbnail(videoFilePath[36],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[36].setImageBitmap(thumbnail[36]);

       videoFilePath[37] = getExternalFilesDir(null)+"/g37.mkv";
        thumbnail[37] = ThumbnailUtils.createVideoThumbnail(videoFilePath[37],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[37].setImageBitmap(thumbnail[37]);

       videoFilePath[38] = getExternalFilesDir(null)+"/g38.mkv";
        thumbnail[38] = ThumbnailUtils.createVideoThumbnail(videoFilePath[38],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[38].setImageBitmap(thumbnail[38]);

       videoFilePath[39] = getExternalFilesDir(null)+"/g39.mkv";
        thumbnail[39] = ThumbnailUtils.createVideoThumbnail(videoFilePath[39],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[39].setImageBitmap(thumbnail[39]);

       videoFilePath[40] = getExternalFilesDir(null)+"/g40.mkv";
        thumbnail[40] = ThumbnailUtils.createVideoThumbnail(videoFilePath[40],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[40].setImageBitmap(thumbnail[40]);

       videoFilePath[41] = getExternalFilesDir(null)+"/g41.mkv";
        thumbnail[41] = ThumbnailUtils.createVideoThumbnail(videoFilePath[41],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[41].setImageBitmap(thumbnail[41]);

       videoFilePath[42] = getExternalFilesDir(null)+"/g42.mkv";
        thumbnail[42] = ThumbnailUtils.createVideoThumbnail(videoFilePath[42],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[42].setImageBitmap(thumbnail[42]);

       videoFilePath[43] = getExternalFilesDir(null)+"/g43.mkv";
        thumbnail[43] = ThumbnailUtils.createVideoThumbnail(videoFilePath[43],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[43].setImageBitmap(thumbnail[43]);

       videoFilePath[44] = getExternalFilesDir(null)+"/g44.mkv";
        thumbnail[44] = ThumbnailUtils.createVideoThumbnail(videoFilePath[44],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[44].setImageBitmap(thumbnail[44]);

       videoFilePath[45] = getExternalFilesDir(null)+"/g45.mkv";
        thumbnail[45] = ThumbnailUtils.createVideoThumbnail(videoFilePath[45],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[45].setImageBitmap(thumbnail[45]);

       videoFilePath[46] = getExternalFilesDir(null)+"/g46.mkv";
        thumbnail[46] = ThumbnailUtils.createVideoThumbnail(videoFilePath[46],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[46].setImageBitmap(thumbnail[46]);

       videoFilePath[47] = getExternalFilesDir(null)+"/g47.mkv";
        thumbnail[47] = ThumbnailUtils.createVideoThumbnail(videoFilePath[47],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[47].setImageBitmap(thumbnail[47]);

       videoFilePath[48] = getExternalFilesDir(null)+"/g48.mkv";
        thumbnail[48] = ThumbnailUtils.createVideoThumbnail(videoFilePath[48],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[48].setImageBitmap(thumbnail[48]);

       videoFilePath[49] = getExternalFilesDir(null)+"/g49.mkv";
        thumbnail[49] = ThumbnailUtils.createVideoThumbnail(videoFilePath[49],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[49].setImageBitmap(thumbnail[49]);

       videoFilePath[50] = getExternalFilesDir(null)+"/g50.mkv";
        thumbnail[50] = ThumbnailUtils.createVideoThumbnail(videoFilePath[50],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[50].setImageBitmap(thumbnail[50]);

       videoFilePath[51] = getExternalFilesDir(null)+"/g51.mkv";
        thumbnail[51] = ThumbnailUtils.createVideoThumbnail(videoFilePath[51],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[51].setImageBitmap(thumbnail[51]);

       videoFilePath[52] = getExternalFilesDir(null)+"/g52.mkv";
        thumbnail[52] = ThumbnailUtils.createVideoThumbnail(videoFilePath[52],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[52].setImageBitmap(thumbnail[52]);

       videoFilePath[53] = getExternalFilesDir(null)+"/g53.mkv";
        thumbnail[53] = ThumbnailUtils.createVideoThumbnail(videoFilePath[53],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[53].setImageBitmap(thumbnail[53]);

       videoFilePath[54] = getExternalFilesDir(null)+"/g54.mkv";
        thumbnail[54] = ThumbnailUtils.createVideoThumbnail(videoFilePath[54],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[54].setImageBitmap(thumbnail[54]);

       videoFilePath[55] = getExternalFilesDir(null)+"/g55.mkv";
        thumbnail[55] = ThumbnailUtils.createVideoThumbnail(videoFilePath[55],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[55].setImageBitmap(thumbnail[55]);

       videoFilePath[56] = getExternalFilesDir(null)+"/g56.mkv";
        thumbnail[56] = ThumbnailUtils.createVideoThumbnail(videoFilePath[56],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[56].setImageBitmap(thumbnail[56]);

       videoFilePath[57] = getExternalFilesDir(null)+"/g57.mkv";
        thumbnail[57] = ThumbnailUtils.createVideoThumbnail(videoFilePath[57],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[57].setImageBitmap(thumbnail[57]);

       videoFilePath[58] = getExternalFilesDir(null)+"/g58.mkv";
        thumbnail[58] = ThumbnailUtils.createVideoThumbnail(videoFilePath[58],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[58].setImageBitmap(thumbnail[58]);

       videoFilePath[59] = getExternalFilesDir(null)+"/g59.mkv";
        thumbnail[59] = ThumbnailUtils.createVideoThumbnail(videoFilePath[59],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[59].setImageBitmap(thumbnail[59]);

       videoFilePath[60] = getExternalFilesDir(null)+"/g60.mkv";
        thumbnail[60] = ThumbnailUtils.createVideoThumbnail(videoFilePath[60],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[60].setImageBitmap(thumbnail[60]);

       videoFilePath[61] = getExternalFilesDir(null)+"/g61.mkv";
        thumbnail[61] = ThumbnailUtils.createVideoThumbnail(videoFilePath[61],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[61].setImageBitmap(thumbnail[61]);

       videoFilePath[62] = getExternalFilesDir(null)+"/g62.mkv";
        thumbnail[62] = ThumbnailUtils.createVideoThumbnail(videoFilePath[62],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[62].setImageBitmap(thumbnail[62]);

       videoFilePath[63] = getExternalFilesDir(null)+"/g63.mkv";
        thumbnail[63] = ThumbnailUtils.createVideoThumbnail(videoFilePath[63],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[63].setImageBitmap(thumbnail[63]);

       videoFilePath[64] = getExternalFilesDir(null)+"/g64.mkv";
        thumbnail[64] = ThumbnailUtils.createVideoThumbnail(videoFilePath[64],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[64].setImageBitmap(thumbnail[64]);

       videoFilePath[65] = getExternalFilesDir(null)+"/g65.mkv";
        thumbnail[65] = ThumbnailUtils.createVideoThumbnail(videoFilePath[65],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[65].setImageBitmap(thumbnail[65]);

       videoFilePath[66] = getExternalFilesDir(null)+"/g66.mkv";
        thumbnail[66] = ThumbnailUtils.createVideoThumbnail(videoFilePath[66],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[66].setImageBitmap(thumbnail[66]);

       videoFilePath[67] = getExternalFilesDir(null)+"/g67.mkv";
        thumbnail[67] = ThumbnailUtils.createVideoThumbnail(videoFilePath[67],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[67].setImageBitmap(thumbnail[67]);

       videoFilePath[68] = getExternalFilesDir(null)+"/g68.mkv";
        thumbnail[68] = ThumbnailUtils.createVideoThumbnail(videoFilePath[68],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[68].setImageBitmap(thumbnail[68]);

       videoFilePath[69] = getExternalFilesDir(null)+"/g69.mkv";
        thumbnail[69] = ThumbnailUtils.createVideoThumbnail(videoFilePath[69],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[69].setImageBitmap(thumbnail[69]);

       videoFilePath[70] = getExternalFilesDir(null)+"/g70.mkv";
        thumbnail[70] = ThumbnailUtils.createVideoThumbnail(videoFilePath[70],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[70].setImageBitmap(thumbnail[70]);

       videoFilePath[71] = getExternalFilesDir(null)+"/g71.mkv";
        thumbnail[71] = ThumbnailUtils.createVideoThumbnail(videoFilePath[71],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[71].setImageBitmap(thumbnail[71]);

       videoFilePath[72] = getExternalFilesDir(null)+"/g72.mkv";
        thumbnail[72] = ThumbnailUtils.createVideoThumbnail(videoFilePath[72],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[72].setImageBitmap(thumbnail[72]);

       videoFilePath[73] = getExternalFilesDir(null)+"/g73.mkv";
        thumbnail[73] = ThumbnailUtils.createVideoThumbnail(videoFilePath[73],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[73].setImageBitmap(thumbnail[73]);

       videoFilePath[74] = getExternalFilesDir(null)+"/g74.mkv";
        thumbnail[74] = ThumbnailUtils.createVideoThumbnail(videoFilePath[74],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[74].setImageBitmap(thumbnail[74]);

       videoFilePath[75] = getExternalFilesDir(null)+"/g75.mkv";
        thumbnail[75] = ThumbnailUtils.createVideoThumbnail(videoFilePath[75],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[75].setImageBitmap(thumbnail[75]);

       videoFilePath[76] = getExternalFilesDir(null)+"/g76.mkv";
        thumbnail[76] = ThumbnailUtils.createVideoThumbnail(videoFilePath[76],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[76].setImageBitmap(thumbnail[76]);

       videoFilePath[77] = getExternalFilesDir(null)+"/g77.mkv";
        thumbnail[77] = ThumbnailUtils.createVideoThumbnail(videoFilePath[77],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[77].setImageBitmap(thumbnail[77]);

       videoFilePath[78] = getExternalFilesDir(null)+"/g78.mkv";
        thumbnail[78] = ThumbnailUtils.createVideoThumbnail(videoFilePath[78],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[78].setImageBitmap(thumbnail[78]);

       videoFilePath[79] = getExternalFilesDir(null)+"/g79.mkv";
        thumbnail[79] = ThumbnailUtils.createVideoThumbnail(videoFilePath[79],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[79].setImageBitmap(thumbnail[79]);

       videoFilePath[80] = getExternalFilesDir(null)+"/g80.mkv";
        thumbnail[80] = ThumbnailUtils.createVideoThumbnail(videoFilePath[80],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[80].setImageBitmap(thumbnail[80]);

       videoFilePath[81] = getExternalFilesDir(null)+"/g81.mkv";
        thumbnail[81] = ThumbnailUtils.createVideoThumbnail(videoFilePath[81],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[81].setImageBitmap(thumbnail[81]);

       videoFilePath[82] = getExternalFilesDir(null)+"/g82.mkv";
        thumbnail[82] = ThumbnailUtils.createVideoThumbnail(videoFilePath[82],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[82].setImageBitmap(thumbnail[3]);

       videoFilePath[83] = getExternalFilesDir(null)+"/g83.mkv";
        thumbnail[83] = ThumbnailUtils.createVideoThumbnail(videoFilePath[83],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[83].setImageBitmap(thumbnail[83]);

       videoFilePath[84] = getExternalFilesDir(null)+"/g84.mkv";
        thumbnail[84] = ThumbnailUtils.createVideoThumbnail(videoFilePath[84],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[84].setImageBitmap(thumbnail[84]);

       videoFilePath[85] = getExternalFilesDir(null)+"/g85.mkv";
        thumbnail[85] = ThumbnailUtils.createVideoThumbnail(videoFilePath[85],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[85].setImageBitmap(thumbnail[85]);

       videoFilePath[86] = getExternalFilesDir(null)+"/g86.mkv";
        thumbnail[86] = ThumbnailUtils.createVideoThumbnail(videoFilePath[86],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[86].setImageBitmap(thumbnail[86]);

       videoFilePath[87] = getExternalFilesDir(null)+"/g87.mkv";
        thumbnail[87] = ThumbnailUtils.createVideoThumbnail(videoFilePath[87],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[87].setImageBitmap(thumbnail[87]);

       videoFilePath[88] = getExternalFilesDir(null)+"/g88.mkv";
        thumbnail[88] = ThumbnailUtils.createVideoThumbnail(videoFilePath[88],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[88].setImageBitmap(thumbnail[88]);

       videoFilePath[89] = getExternalFilesDir(null)+"/g89.mkv";
        thumbnail[89] = ThumbnailUtils.createVideoThumbnail(videoFilePath[89],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[89].setImageBitmap(thumbnail[89]);

       videoFilePath[90] = getExternalFilesDir(null)+"/g90.mkv";
        thumbnail[90] = ThumbnailUtils.createVideoThumbnail(videoFilePath[90],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[90].setImageBitmap(thumbnail[90]);

       videoFilePath[91] = getExternalFilesDir(null)+"/g91.mkv";
        thumbnail[91] = ThumbnailUtils.createVideoThumbnail(videoFilePath[91],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[91].setImageBitmap(thumbnail[91]);

       videoFilePath[92] = getExternalFilesDir(null)+"/g92.mkv";
        thumbnail[92] = ThumbnailUtils.createVideoThumbnail(videoFilePath[92],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[92].setImageBitmap(thumbnail[92]);

       videoFilePath[93] = getExternalFilesDir(null)+"/g93.mkv";
        thumbnail[93] = ThumbnailUtils.createVideoThumbnail(videoFilePath[93],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[93].setImageBitmap(thumbnail[93]);

       videoFilePath[94] = getExternalFilesDir(null)+"/g94.mkv";
        thumbnail[94] = ThumbnailUtils.createVideoThumbnail(videoFilePath[94],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[94].setImageBitmap(thumbnail[94]);

       videoFilePath[95] = getExternalFilesDir(null)+"/g95.mkv";
        thumbnail[95] = ThumbnailUtils.createVideoThumbnail(videoFilePath[95],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[95].setImageBitmap(thumbnail[95]);

       videoFilePath[96] = getExternalFilesDir(null)+"/g96.mkv";
        thumbnail[96] = ThumbnailUtils.createVideoThumbnail(videoFilePath[96],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[96].setImageBitmap(thumbnail[96]);

       videoFilePath[97] = getExternalFilesDir(null)+"/g97.mkv";
        thumbnail[97] = ThumbnailUtils.createVideoThumbnail(videoFilePath[97],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[97].setImageBitmap(thumbnail[97]);

       videoFilePath[98] = getExternalFilesDir(null)+"/g98.mkv";
        thumbnail[98] = ThumbnailUtils.createVideoThumbnail(videoFilePath[98],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[98].setImageBitmap(thumbnail[98]);

       videoFilePath[99] = getExternalFilesDir(null)+"/g99.mkv";
        thumbnail[99] = ThumbnailUtils.createVideoThumbnail(videoFilePath[99],
                MediaStore.Images.Thumbnails.MINI_KIND);
        g[99].setImageBitmap(thumbnail[99]);
*/
        dialog.cancel();

    }


    private void copyAssets() {
        AssetManager assetManager = getAssets();
        String[] files = null;
        try {
            files = assetManager.list("");
        } catch (IOException e) {
            Log.e("tag", "Failed to get asset file list.", e);
        }
        if (files != null) for (String filename : files) {
            InputStream in = null;
            OutputStream out = null;
            try {
                in = assetManager.open(filename);
                File outFile = new File(getExternalFilesDir(null), filename);
                out = new FileOutputStream(outFile);
                copyFile(in, out);
            } catch(IOException e) {
                Log.e("tag", "Failed to copy asset file: " + filename, e);
            }
            finally {
                if (in != null) {
                    try {
                        in.close();
                    } catch (IOException e) {
                        // NOOP
                    }
                }
                if (out != null) {
                    try {
                        out.close();
                    } catch (IOException e) {
                        // NOOP
                    }
                }
            }
        }
    }
    private void copyFile(InputStream in, OutputStream out) throws IOException {
        byte[] buffer = new byte[1024];
        int read;
        while((read = in.read(buffer)) != -1){
            out.write(buffer, 0, read);
        }
    }



    public boolean checkExtenalstoragestate(){
        String state=Environment.getExternalStorageState();
        if (state.equals(Environment.MEDIA_MOUNTED)){
          //  Toast.makeText(getApplicationContext(),"external storage exist",Toast.LENGTH_LONG).show();
            return true;
        }else if (state.equals(Environment.MEDIA_MOUNTED_READ_ONLY)){
            Toast.makeText(getApplicationContext(),"Sorry!! external storage is readonly",Toast.LENGTH_LONG).show();

        }
        else{
            Toast.makeText(getApplicationContext(),"Sorry!! external storage not exist",Toast.LENGTH_LONG).show();

        }
        return false;
    }


   public void playvideo(View view) {
        switch (view.getId()){
            case R.id.img_g1:

                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                File file=new File(sdcard+"/g1.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
                  case R.id.img_g2:
                 intent=new Intent(Intent.ACTION_VIEW);
                File sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g2.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);

                break;
                  case R.id.img_g3:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g3.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                      if (mInterstitialAd.isLoaded()) {
                          mInterstitialAd.show();
                      } else {
                          Log.d("TAG", "The interstitial wasn't loaded yet.");
                      }
                break;
           case R.id.img_g4:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g4.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g5:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g5.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g6:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g6.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
               if (mInterstitialAd.isLoaded()) {
                   mInterstitialAd.show();
               } else {
                   Log.d("TAG", "The interstitial wasn't loaded yet.");
               }
                break;
           case R.id.img_g7:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g7.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g8:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g8.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g9:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g9.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
               if (mInterstitialAd.isLoaded()) {
                   mInterstitialAd.show();
               } else {
                   Log.d("TAG", "The interstitial wasn't loaded yet.");
               }
                break;
           case R.id.img_g10:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g10.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g11:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g11.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g12:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g12.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
               if (mInterstitialAd.isLoaded()) {
                   mInterstitialAd.show();
               } else {
                   Log.d("TAG", "The interstitial wasn't loaded yet.");
               }
                break;
           case R.id.img_g13:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g13.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g14:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g14.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g15:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g15.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
               if (mInterstitialAd.isLoaded()) {
                   mInterstitialAd.show();
               } else {
                   Log.d("TAG", "The interstitial wasn't loaded yet.");
               }
                break;
           case R.id.img_g16:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g16.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g17:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g17.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g18:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g18.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
               if (mInterstitialAd.isLoaded()) {
                   mInterstitialAd.show();
               } else {
                   Log.d("TAG", "The interstitial wasn't loaded yet.");
               }
                break;
           case R.id.img_g19:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g19.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g20:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g20.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g21:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g21.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
               if (mInterstitialAd.isLoaded()) {
                   mInterstitialAd.show();
               } else {
                   Log.d("TAG", "The interstitial wasn't loaded yet.");
               }
                break;
           case R.id.img_g22:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g22.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g23:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g23.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g24:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g24.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
               if (mInterstitialAd.isLoaded()) {
                   mInterstitialAd.show();
               } else {
                   Log.d("TAG", "The interstitial wasn't loaded yet.");
               }
                break;
           case R.id.img_g25:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g25.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g26:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g26.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g27:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g27.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
               if (mInterstitialAd.isLoaded()) {
                   mInterstitialAd.show();
               } else {
                   Log.d("TAG", "The interstitial wasn't loaded yet.");
               }
                break;
           case R.id.img_g28:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g28.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g29:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g29.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g30:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g30.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
               if (mInterstitialAd.isLoaded()) {
                   mInterstitialAd.show();
               } else {
                   Log.d("TAG", "The interstitial wasn't loaded yet.");
               }
                break;
           case R.id.img_g31:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g31.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g32:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g32.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g33:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g33.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
               if (mInterstitialAd.isLoaded()) {
                   mInterstitialAd.show();
               } else {
                   Log.d("TAG", "The interstitial wasn't loaded yet.");
               }
                break;
           case R.id.img_g34:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g34.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g35:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g35.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g36:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g36.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
               if (mInterstitialAd.isLoaded()) {
                   mInterstitialAd.show();
               } else {
                   Log.d("TAG", "The interstitial wasn't loaded yet.");
               }
                break;
           case R.id.img_g37:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g37.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g38:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g38.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g39:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g39.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
               if (mInterstitialAd.isLoaded()) {
                   mInterstitialAd.show();
               } else {
                   Log.d("TAG", "The interstitial wasn't loaded yet.");
               }
                break;
           case R.id.img_g40:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g40.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g41:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g41.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g42:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g42.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
               if (mInterstitialAd.isLoaded()) {
                   mInterstitialAd.show();
               } else {
                   Log.d("TAG", "The interstitial wasn't loaded yet.");
               }
                break;
           case R.id.img_g43:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g43.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g44:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g44.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g45:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g45.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
               if (mInterstitialAd.isLoaded()) {
                   mInterstitialAd.show();
               } else {
                   Log.d("TAG", "The interstitial wasn't loaded yet.");
               }
                break;
           case R.id.img_g46:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g46.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g47:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g47.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g48:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g48.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
               if (mInterstitialAd.isLoaded()) {
                   mInterstitialAd.show();
               } else {
                   Log.d("TAG", "The interstitial wasn't loaded yet.");
               }
                break;
           case R.id.img_g49:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g49.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g50:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g50.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g51:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g51.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
               if (mInterstitialAd.isLoaded()) {
                   mInterstitialAd.show();
               } else {
                   Log.d("TAG", "The interstitial wasn't loaded yet.");
               }
                break;
           case R.id.img_g52:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g52.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g53:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g53.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g54:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g54.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
               if (mInterstitialAd.isLoaded()) {
                   mInterstitialAd.show();
               } else {
                   Log.d("TAG", "The interstitial wasn't loaded yet.");
               }
                break;
           case R.id.img_g55:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g55.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g56:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g56.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g57:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g57.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
               if (mInterstitialAd.isLoaded()) {
                   mInterstitialAd.show();
               } else {
                   Log.d("TAG", "The interstitial wasn't loaded yet.");
               }
                break;
           case R.id.img_g58:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g58.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g59:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g59.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g60:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g60.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
               if (mInterstitialAd.isLoaded()) {
                   mInterstitialAd.show();
               } else {
                   Log.d("TAG", "The interstitial wasn't loaded yet.");
               }
                break;
           case R.id.img_g61:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g61.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g62:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g62.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g63:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g63.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
               if (mInterstitialAd.isLoaded()) {
                   mInterstitialAd.show();
               } else {
                   Log.d("TAG", "The interstitial wasn't loaded yet.");
               }
                break;
           case R.id.img_g64:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g64.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g65:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g65.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g66:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g66.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
               if (mInterstitialAd.isLoaded()) {
                   mInterstitialAd.show();
               } else {
                   Log.d("TAG", "The interstitial wasn't loaded yet.");
               }
                break;
           case R.id.img_g67:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g67.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g68:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g68.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g69:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g69.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
               if (mInterstitialAd.isLoaded()) {
                   mInterstitialAd.show();
               } else {
                   Log.d("TAG", "The interstitial wasn't loaded yet.");
               }
                break;
           case R.id.img_g70:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g70.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g71:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g71.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g72:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g72.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
               if (mInterstitialAd.isLoaded()) {
                   mInterstitialAd.show();
               } else {
                   Log.d("TAG", "The interstitial wasn't loaded yet.");
               }
                break;
           case R.id.img_g73:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g73.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g74:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g74.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g75:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g75.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
               if (mInterstitialAd.isLoaded()) {
                   mInterstitialAd.show();
               } else {
                   Log.d("TAG", "The interstitial wasn't loaded yet.");
               }
                break;
           case R.id.img_g76:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g76.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g77:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g77.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g78:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g78.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
               if (mInterstitialAd.isLoaded()) {
                   mInterstitialAd.show();
               } else {
                   Log.d("TAG", "The interstitial wasn't loaded yet.");
               }
                break;
           case R.id.img_g79:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g79.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g80:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g80.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g81:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g81.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
               if (mInterstitialAd.isLoaded()) {
                   mInterstitialAd.show();
               } else {
                   Log.d("TAG", "The interstitial wasn't loaded yet.");
               }
                break;
           case R.id.img_g82:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g82.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g83:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g83.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g84:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g84.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
               if (mInterstitialAd.isLoaded()) {
                   mInterstitialAd.show();
               } else {
                   Log.d("TAG", "The interstitial wasn't loaded yet.");
               }
                break;
           case R.id.img_g85:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g85.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g86:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g86.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g87:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g87.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
               if (mInterstitialAd.isLoaded()) {
                   mInterstitialAd.show();
               } else {
                   Log.d("TAG", "The interstitial wasn't loaded yet.");
               }
                break;
           case R.id.img_g88:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g88.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g89:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g89.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g90:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g90.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
               if (mInterstitialAd.isLoaded()) {
                   mInterstitialAd.show();
               } else {
                   Log.d("TAG", "The interstitial wasn't loaded yet.");
               }
                break;
           case R.id.img_g91:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g91.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g92:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g92.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g93:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g93.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
               if (mInterstitialAd.isLoaded()) {
                   mInterstitialAd.show();
               } else {
                   Log.d("TAG", "The interstitial wasn't loaded yet.");
               }
                break;
           case R.id.img_g94:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g94.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g95:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g95.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g96:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g96.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
               if (mInterstitialAd.isLoaded()) {
                   mInterstitialAd.show();
               } else {
                   Log.d("TAG", "The interstitial wasn't loaded yet.");
               }
                break;
           case R.id.img_g97:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g97.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g98:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g98.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
                break;
           case R.id.img_g99:
                 intent=new Intent(Intent.ACTION_VIEW);
                 sdcard=getExternalFilesDir(null);
                 file=new File(sdcard+"/g99.mkv");
                intent.setDataAndType(Uri.fromFile(file),"video/*");
                startActivity(intent);
               if (mInterstitialAd.isLoaded()) {
                   mInterstitialAd.show();
               } else {
                   Log.d("TAG", "The interstitial wasn't loaded yet.");
               }
                break;

        }



    }


    public void favcheck(View view) {
        switch (view.getId()){
            case R.id.fav1:
               isfav[1]=!isfav[1];
               if (isfav[1]){
                   fav[1].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[1].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit = sp.edit();
                edit.putBoolean("isfav1", isfav[1]);
                edit.apply();
                break;
    case R.id.fav2:
               isfav[2]=!isfav[2];
               if (isfav[2]){
                   fav[2].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[2].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit2 = sp.edit();
                edit2.putBoolean("isfav2", isfav[2]);
                edit2.apply();
                break;
    case R.id.fav3:
               isfav[3]=!isfav[3];
               if (isfav[3]){
                   fav[3].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[3].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit3 = sp.edit();
                edit3.putBoolean("isfav3", isfav[3]);
                edit3.apply();
                break;
    case R.id.fav4:
               isfav[4]=!isfav[4];
               if (isfav[4]){
                   fav[4].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[4].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit4 = sp.edit();
                edit4.putBoolean("isfav4", isfav[4]);
                edit4.apply();
                break;
    case R.id.fav5:
               isfav[5]=!isfav[5];
               if (isfav[5]){
                   fav[5].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[5].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit5 = sp.edit();
                edit5.putBoolean("isfav5", isfav[5]);
                edit5.apply();
                break;
    case R.id.fav6:
               isfav[6]=!isfav[6];
               if (isfav[6]){
                   fav[6].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[6].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit6 = sp.edit();
                edit6.putBoolean("isfav6", isfav[6]);
                edit6.apply();
                break;
    case R.id.fav7:
               isfav[7]=!isfav[7];
               if (isfav[7]){
                   fav[7].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[7].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit7 = sp.edit();
                edit7.putBoolean("isfav7", isfav[7]);
                edit7.apply();
                break;
    case R.id.fav8:
               isfav[8]=!isfav[8];
               if (isfav[8]){
                   fav[8].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[8].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit8 = sp.edit();
                edit8.putBoolean("isfav8", isfav[8]);
                edit8.apply();
                break;
    case R.id.fav9:
               isfav[9]=!isfav[9];
               if (isfav[9]){
                   fav[9].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[9].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit9= sp.edit();
                edit9.putBoolean("isfav9", isfav[9]);
                edit9.apply();
                break;
    case R.id.fav10:
               isfav[10]=!isfav[10];
               if (isfav[10]){
                   fav[10].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[10].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit10 = sp.edit();
                edit10.putBoolean("isfav10", isfav[10]);
                edit10.apply();
                break;
    case R.id.fav11:
               isfav[11]=!isfav[11];
               if (isfav[11]){
                   fav[11].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[11].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit11 = sp.edit();
                edit11.putBoolean("isfav11", isfav[11]);
                edit11.apply();
                break;
    case R.id.fav12:
               isfav[12]=!isfav[12];
               if (isfav[12]){
                   fav[12].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[12].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit12 = sp.edit();
                edit12.putBoolean("isfav12", isfav[12]);
                edit12.apply();
                break;
    case R.id.fav13:
               isfav[13]=!isfav[13];
               if (isfav[13]){
                   fav[13].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[13].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit13 = sp.edit();
                edit13.putBoolean("isfav13", isfav[13]);
                edit13.apply();
                break;
    case R.id.fav14:
               isfav[14]=!isfav[14];
               if (isfav[14]){
                   fav[14].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[14].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit14 = sp.edit();
                edit14.putBoolean("isfav14", isfav[14]);
                edit14.apply();
                break;
    case R.id.fav15:
               isfav[15]=!isfav[15];
               if (isfav[15]){
                   fav[15].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[15].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit15 = sp.edit();
                edit15.putBoolean("isfav15", isfav[15]);
                edit15.apply();
                break;
    case R.id.fav16:
               isfav[16]=!isfav[16];
               if (isfav[16]){
                   fav[16].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[16].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit16 = sp.edit();
                edit16.putBoolean("isfav16", isfav[16]);
                edit16.apply();
                break;
    case R.id.fav17:
               isfav[17]=!isfav[17];
               if (isfav[17]){
                   fav[17].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[17].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit17 = sp.edit();
                edit17.putBoolean("isfav17", isfav[17]);
                edit17.apply();
                break;
    case R.id.fav18:
               isfav[18]=!isfav[18];
               if (isfav[18]){
                   fav[18].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[18].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit18 = sp.edit();
                edit18.putBoolean("isfav18", isfav[18]);
                edit18.apply();
                break;
    case R.id.fav19:
               isfav[19]=!isfav[19];
               if (isfav[19]){
                   fav[19].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[19].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit19 = sp.edit();
                edit19.putBoolean("isfav19", isfav[19]);
                edit19.apply();
                break;
    case R.id.fav20:
               isfav[20]=!isfav[20];
               if (isfav[20]){
                   fav[20].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[20].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit20 = sp.edit();
                edit20.putBoolean("isfav20", isfav[20]);
                edit20.apply();
                break;
    case R.id.fav21:
               isfav[21]=!isfav[21];
               if (isfav[21]){
                   fav[21].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[21].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit21 = sp.edit();
                edit21.putBoolean("isfav21", isfav[1]);
                edit21.apply();
                break;
    case R.id.fav22:
               isfav[22]=!isfav[22];
               if (isfav[22]){
                   fav[22].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[22].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit22 = sp.edit();
                edit22.putBoolean("isfav22", isfav[22]);
                edit22.apply();
                break;
    case R.id.fav23:
               isfav[23]=!isfav[23];
               if (isfav[23]){
                   fav[23].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[23].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit23 = sp.edit();
                edit23.putBoolean("isfav23", isfav[23]);
                edit23.apply();
                break;
    case R.id.fav24:
               isfav[24]=!isfav[24];
               if (isfav[24]){
                   fav[24].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[24].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit24 = sp.edit();
                edit24.putBoolean("isfav24", isfav[24]);
                edit24.apply();
                break;
    case R.id.fav25:
               isfav[25]=!isfav[25];
               if (isfav[25]){
                   fav[25].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[25].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit25 = sp.edit();
                edit25.putBoolean("isfav25", isfav[25]);
                edit25.apply();
                break;
    case R.id.fav26:
               isfav[26]=!isfav[26];
               if (isfav[26]){
                   fav[26].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[26].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit26 = sp.edit();
                edit26.putBoolean("isfav26", isfav[26]);
                edit26.apply();
                break;
    case R.id.fav27:
               isfav[27]=!isfav[27];
               if (isfav[27]){
                   fav[27].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[27].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit27 = sp.edit();
                edit27.putBoolean("isfav27", isfav[27]);
                edit27.apply();
                break;
    case R.id.fav28:
               isfav[28]=!isfav[28];
               if (isfav[28]){
                   fav[28].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[28].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit28 = sp.edit();
                edit28.putBoolean("isfav28", isfav[28]);
                edit28.apply();
                break;
    case R.id.fav29:
               isfav[29]=!isfav[29];
               if (isfav[29]){
                   fav[29].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[29].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit29 = sp.edit();
                edit29.putBoolean("isfav29", isfav[1]);
                edit29.apply();
                break;
    case R.id.fav30:
               isfav[30]=!isfav[30];
               if (isfav[30]){
                   fav[30].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[30].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit30 = sp.edit();
                edit30.putBoolean("isfav30", isfav[30]);
                edit30.apply();
                break;
    case R.id.fav31:
               isfav[31]=!isfav[31];
               if (isfav[31]){
                   fav[31].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[31].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit31 = sp.edit();
                edit31.putBoolean("isfav31", isfav[31]);
                edit31.apply();
                break;
    case R.id.fav32:
               isfav[32]=!isfav[32];
               if (isfav[32]){
                   fav[32].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[32].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit32 = sp.edit();
                edit32.putBoolean("isfav32", isfav[32]);
                edit32.apply();
                break;
    case R.id.fav33:
               isfav[33]=!isfav[33];
               if (isfav[33]){
                   fav[33].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[33].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit33 = sp.edit();
                edit33.putBoolean("isfav33", isfav[33]);
                edit33.apply();
                break;
    case R.id.fav34:
               isfav[34]=!isfav[34];
               if (isfav[34]){
                   fav[34].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[34].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit34 = sp.edit();
                edit34.putBoolean("isfav34", isfav[34]);
                edit34.apply();
                break;
    case R.id.fav35:
               isfav[35]=!isfav[35];
               if (isfav[35]){
                   fav[35].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[35].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit35 = sp.edit();
                edit35.putBoolean("isfav35", isfav[35]);
                edit35.apply();
                break;
    case R.id.fav36:
               isfav[36]=!isfav[36];
               if (isfav[36]){
                   fav[36].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[36].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit36 = sp.edit();
                edit36.putBoolean("isfav36", isfav[36]);
                edit36.apply();
                break;
    case R.id.fav37:
               isfav[37]=!isfav[37];
               if (isfav[37]){
                   fav[37].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[37].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit37 = sp.edit();
                edit37.putBoolean("isfav37", isfav[37]);
                edit37.apply();
                break;
    case R.id.fav38:
               isfav[38]=!isfav[38];
               if (isfav[38]){
                   fav[38].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[38].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit38 = sp.edit();
                edit38.putBoolean("isfav38", isfav[38]);
                edit38.apply();
                break;
    case R.id.fav39:
               isfav[39]=!isfav[39];
               if (isfav[39]){
                   fav[39].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[39].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit39 = sp.edit();
                edit39.putBoolean("isfav39", isfav[39]);
                edit39.apply();
                break;
    case R.id.fav40:
               isfav[40]=!isfav[40];
               if (isfav[40]){
                   fav[40].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[40].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit40 = sp.edit();
                edit40.putBoolean("isfav40", isfav[40]);
                edit40.apply();
                break;
    case R.id.fav41:
               isfav[41]=!isfav[41];
               if (isfav[41]){
                   fav[41].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[41].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit41 = sp.edit();
                edit41.putBoolean("isfav41", isfav[41]);
                edit41.apply();
                break;
    case R.id.fav42:
               isfav[42]=!isfav[42];
               if (isfav[42]){
                   fav[42].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[42].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit42 = sp.edit();
                edit42.putBoolean("isfav42", isfav[42]);
                edit42.apply();
                break;
    case R.id.fav43:
               isfav[43]=!isfav[43];
               if (isfav[43]){
                   fav[43].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[43].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit43 = sp.edit();
                edit43.putBoolean("isfav43", isfav[43]);
                edit43.apply();
                break;
    case R.id.fav44:
               isfav[44]=!isfav[44];
               if (isfav[44]){
                   fav[44].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[44].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit44 = sp.edit();
                edit44.putBoolean("isfav44", isfav[44]);
                edit44.apply();
                break;
    case R.id.fav45:
               isfav[45]=!isfav[45];
               if (isfav[45]){
                   fav[45].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[45].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit45 = sp.edit();
                edit45.putBoolean("isfav45", isfav[45]);
                edit45.apply();
                break;
    case R.id.fav46:
               isfav[46]=!isfav[46];
               if (isfav[46]){
                   fav[46].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[46].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit46 = sp.edit();
                edit46.putBoolean("isfav46", isfav[46]);
                edit46.apply();
                break;
    case R.id.fav47:
               isfav[47]=!isfav[47];
               if (isfav[47]){
                   fav[47].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[47].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit47 = sp.edit();
                edit47.putBoolean("isfav47", isfav[47]);
                edit47.apply();
                break;
    case R.id.fav48:
               isfav[48]=!isfav[48];
               if (isfav[48]){
                   fav[48].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[48].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit48 = sp.edit();
                edit48.putBoolean("isfav48", isfav[48]);
                edit48.apply();
                break;
    case R.id.fav49:
               isfav[49]=!isfav[49];
               if (isfav[49]){
                   fav[49].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[49].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit49 = sp.edit();
                edit49.putBoolean("isfav49", isfav[49]);
                edit49.apply();
                break;
    case R.id.fav50:
               isfav[50]=!isfav[50];
               if (isfav[50]){
                   fav[50].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[50].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit50 = sp.edit();
                edit50.putBoolean("isfav50", isfav[50]);
                edit50.apply();
                break;
    case R.id.fav51:
               isfav[51]=!isfav[51];
               if (isfav[51]){
                   fav[51].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[51].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit51 = sp.edit();
                edit51.putBoolean("isfav51", isfav[51]);
                edit51.apply();
                break;
    case R.id.fav52:
               isfav[52]=!isfav[52];
               if (isfav[52]){
                   fav[52].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[52].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit52 = sp.edit();
                edit52.putBoolean("isfav52", isfav[52]);
                edit52.apply();
                break;
    case R.id.fav53:
               isfav[53]=!isfav[53];
               if (isfav[53]){
                   fav[53].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[53].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit53 = sp.edit();
                edit53.putBoolean("isfav53", isfav[53]);
                edit53.apply();
                break;
    case R.id.fav54:
               isfav[54]=!isfav[54];
               if (isfav[54]){
                   fav[54].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[54].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit54 = sp.edit();
                edit54.putBoolean("isfav54", isfav[54]);
                edit54.apply();
                break;
    case R.id.fav55:
               isfav[55]=!isfav[55];
               if (isfav[55]){
                   fav[55].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[55].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit55 = sp.edit();
                edit55.putBoolean("isfav55", isfav[55]);
                edit55.apply();
                break;
    case R.id.fav56:
               isfav[56]=!isfav[56];
               if (isfav[56]){
                   fav[56].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[56].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit56 = sp.edit();
                edit56.putBoolean("isfav56", isfav[56]);
                edit56.apply();
                break;
    case R.id.fav57:
               isfav[57]=!isfav[57];
               if (isfav[57]){
                   fav[57].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[57].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit57 = sp.edit();
                edit57.putBoolean("isfav57", isfav[57]);
                edit57.apply();
                break;
    case R.id.fav58:
               isfav[58]=!isfav[58];
               if (isfav[58]){
                   fav[58].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[58].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit58 = sp.edit();
                edit58.putBoolean("isfav58", isfav[58]);
                edit58.apply();
                break;
    case R.id.fav59:
               isfav[59]=!isfav[59];
               if (isfav[59]){
                   fav[59].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[59].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit59 = sp.edit();
                edit59.putBoolean("isfav59", isfav[59]);
                edit59.apply();
                break;
    case R.id.fav60:
               isfav[60]=!isfav[60];
               if (isfav[60]){
                   fav[60].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[60].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit60 = sp.edit();
                edit60.putBoolean("isfav60", isfav[60]);
                edit60.apply();
                break;
    case R.id.fav61:
               isfav[61]=!isfav[61];
               if (isfav[61]){
                   fav[61].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[61].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit61 = sp.edit();
                edit61.putBoolean("isfav61", isfav[61]);
                edit61.apply();
                break;
    case R.id.fav62:
               isfav[62]=!isfav[62];
               if (isfav[62]){
                   fav[62].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[62].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit62 = sp.edit();
                edit62.putBoolean("isfav62", isfav[62]);
                edit62.apply();
                break;
    case R.id.fav63:
               isfav[63]=!isfav[63];
               if (isfav[63]){
                   fav[63].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[63].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit63 = sp.edit();
                edit63.putBoolean("isfav63", isfav[63]);
                edit63.apply();
                break;
    case R.id.fav64:
               isfav[64]=!isfav[64];
               if (isfav[64]){
                   fav[64].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[64].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit64 = sp.edit();
                edit64.putBoolean("isfav64", isfav[64]);
                edit64.apply();
                break;
    case R.id.fav65:
               isfav[65]=!isfav[65];
               if (isfav[65]){
                   fav[65].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[65].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit65 = sp.edit();
                edit65.putBoolean("isfav65", isfav[65]);
                edit65.apply();
                break;
    case R.id.fav66:
               isfav[66]=!isfav[66];
               if (isfav[66]){
                   fav[66].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[66].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit66 = sp.edit();
                edit66.putBoolean("isfav66", isfav[66]);
                edit66.apply();
                break;
    case R.id.fav67:
               isfav[67]=!isfav[67];
               if (isfav[67]){
                   fav[67].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[67].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit67 = sp.edit();
                edit67.putBoolean("isfav67", isfav[67]);
                edit67.apply();
                break;
    case R.id.fav68:
               isfav[68]=!isfav[68];
               if (isfav[68]){
                   fav[68].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[68].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit68 = sp.edit();
                edit68.putBoolean("isfav68", isfav[68]);
                edit68.apply();
                break;
    case R.id.fav69:
               isfav[69]=!isfav[69];
               if (isfav[69]){
                   fav[69].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[69].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit69 = sp.edit();
                edit69.putBoolean("isfav69", isfav[69]);
                edit69.apply();
                break;
    case R.id.fav70:
               isfav[70]=!isfav[70];
               if (isfav[70]){
                   fav[70].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[70].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit70 = sp.edit();
                edit70.putBoolean("isfav70", isfav[70]);
                edit70.apply();
                break;
    case R.id.fav71:
               isfav[71]=!isfav[71];
               if (isfav[71]){
                   fav[71].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[71].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit71 = sp.edit();
                edit71.putBoolean("isfav71", isfav[71]);
                edit71.apply();
                break;
    case R.id.fav72:
               isfav[72]=!isfav[72];
               if (isfav[72]){
                   fav[72].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[72].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit72 = sp.edit();
                edit72.putBoolean("isfav72", isfav[72]);
                edit72.apply();
                break;
    case R.id.fav73:
               isfav[73]=!isfav[73];
               if (isfav[73]){
                   fav[73].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[73].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit73 = sp.edit();
                edit73.putBoolean("isfav73", isfav[73]);
                edit73.apply();
                break;
    case R.id.fav74:
               isfav[74]=!isfav[74];
               if (isfav[74]){
                   fav[74].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[74].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit74 = sp.edit();
                edit74.putBoolean("isfav74", isfav[74]);
                edit74.apply();
                break;
    case R.id.fav75:
               isfav[75]=!isfav[75];
               if (isfav[75]){
                   fav[75].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[75].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit75 = sp.edit();
                edit75.putBoolean("isfav75", isfav[75]);
                edit75.apply();
                break;
    case R.id.fav76:
               isfav[76]=!isfav[76];
               if (isfav[76]){
                   fav[76].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[76].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit76 = sp.edit();
                edit76.putBoolean("isfav76", isfav[76]);
                edit76.apply();
                break;
    case R.id.fav77:
               isfav[77]=!isfav[77];
               if (isfav[77]){
                   fav[77].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[77].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit77 = sp.edit();
                edit77.putBoolean("isfav77", isfav[77]);
                edit77.apply();
                break;
    case R.id.fav78:
               isfav[78]=!isfav[78];
               if (isfav[78]){
                   fav[78].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[78].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit78 = sp.edit();
                edit78.putBoolean("isfav78", isfav[78]);
                edit78.apply();
                break;
    case R.id.fav79:
               isfav[79]=!isfav[79];
               if (isfav[79]){
                   fav[79].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[79].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit79 = sp.edit();
                edit79.putBoolean("isfav79", isfav[79]);
                edit79.apply();
                break;
    case R.id.fav80:
               isfav[80]=!isfav[80];
               if (isfav[80]){
                   fav[80].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[80].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit80 = sp.edit();
                edit80.putBoolean("isfav80", isfav[80]);
                edit80.apply();
                break;
    case R.id.fav81:
               isfav[81]=!isfav[81];
               if (isfav[81]){
                   fav[81].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[81].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit81 = sp.edit();
                edit81.putBoolean("isfav81", isfav[81]);
                edit81.apply();
                break;
    case R.id.fav82:
               isfav[82]=!isfav[82];
               if (isfav[82]){
                   fav[82].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[82].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit82 = sp.edit();
                edit82.putBoolean("isfav82", isfav[82]);
                edit82.apply();
                break;
    case R.id.fav83:
               isfav[83]=!isfav[83];
               if (isfav[83]){
                   fav[83].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[83].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit83 = sp.edit();
                edit83.putBoolean("isfav83", isfav[83]);
                edit83.apply();
                break;
    case R.id.fav84:
               isfav[84]=!isfav[84];
               if (isfav[84]){
                   fav[84].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[84].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit84 = sp.edit();
                edit84.putBoolean("isfav84", isfav[84]);
                edit84.apply();
                break;
    case R.id.fav85:
               isfav[85]=!isfav[85];
               if (isfav[85]){
                   fav[85].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[85].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit85 = sp.edit();
                edit85.putBoolean("isfav85", isfav[85]);
                edit85.apply();
                break;
    case R.id.fav86:
               isfav[86]=!isfav[86];
               if (isfav[86]){
                   fav[86].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[86].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit86 = sp.edit();
                edit86.putBoolean("isfav86", isfav[86]);
                edit86.apply();
                break;
    case R.id.fav87:
               isfav[87]=!isfav[87];
               if (isfav[87]){
                   fav[87].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[87].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit87 = sp.edit();
                edit87.putBoolean("isfav87", isfav[87]);
                edit87.apply();
                break;
    case R.id.fav88:
               isfav[88]=!isfav[88];
               if (isfav[88]){
                   fav[88].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[88].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit88 = sp.edit();
                edit88.putBoolean("isfav88", isfav[88]);
                edit88.apply();
                break;
    case R.id.fav89:
               isfav[89]=!isfav[89];
               if (isfav[89]){
                   fav[89].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[89].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit89 = sp.edit();
                edit89.putBoolean("isfav89", isfav[89]);
                edit89.apply();
                break;
    case R.id.fav90:
               isfav[90]=!isfav[90];
               if (isfav[90]){
                   fav[90].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[90].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit90 = sp.edit();
                edit90.putBoolean("isfav90", isfav[90]);
                edit90.apply();
                break;
    case R.id.fav91:
               isfav[91]=!isfav[91];
               if (isfav[91]){
                   fav[91].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[91].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit91 = sp.edit();
                edit91.putBoolean("isfav91", isfav[91]);
                edit91.apply();
                break;
    case R.id.fav92:
               isfav[92]=!isfav[92];
               if (isfav[92]){
                   fav[92].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[92].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit92 = sp.edit();
                edit92.putBoolean("isfav92", isfav[92]);
                edit92.apply();
                break;
    case R.id.fav93:
               isfav[93]=!isfav[93];
               if (isfav[93]){
                   fav[93].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[93].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit93 = sp.edit();
                edit93.putBoolean("isfav93", isfav[93]);
                edit93.apply();
                break;
    case R.id.fav94:
               isfav[94]=!isfav[94];
               if (isfav[94]){
                   fav[94].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[94].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit94 = sp.edit();
                edit94.putBoolean("isfav94", isfav[94]);
                edit94.apply();
                break;
    case R.id.fav95:
               isfav[95]=!isfav[95];
               if (isfav[95]){
                   fav[95].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[95].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit95 = sp.edit();
                edit95.putBoolean("isfav95", isfav[95]);
                edit95.apply();
                break;
    case R.id.fav96:
               isfav[96]=!isfav[96];
               if (isfav[96]){
                   fav[96].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[96].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit96 = sp.edit();
                edit96.putBoolean("isfav96", isfav[96]);
                edit96.apply();
                break;
    case R.id.fav97:
               isfav[97]=!isfav[97];
               if (isfav[97]){
                   fav[97].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[97].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit97 = sp.edit();
                edit97.putBoolean("isfav97", isfav[97]);
                edit97.apply();
                break;
    case R.id.fav98:
               isfav[98]=!isfav[98];
               if (isfav[98]){
                   fav[98].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[98].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit98 = sp.edit();
                edit98.putBoolean("isfav98", isfav[98]);
                edit98.apply();
                break;
    case R.id.fav99:
               isfav[99]=!isfav[99];
               if (isfav[99]){
                   fav[99].setBackgroundResource(R.drawable.fav);
               }else {
                   fav[99].setBackgroundResource(R.drawable.star);
               }
                sp = getApplicationContext().getSharedPreferences("fav", 0);
                SharedPreferences.Editor edit99 = sp.edit();
                edit99.putBoolean("isfav99", isfav[99]);
                edit99.apply();
                break;


        }
    }

    public void goToMyApps(View view) {
        try {


        }catch (Exception e){

        }

    }

    public void rateApp(View view) {

    }
}
